# -*- coding: utf-8 -*-
from odoo import fields, models, api


class res_partner(models.Model):
    _inherit = 'res.partner'

    user_edit_credit_limit = fields.Boolean(string=u"允许修改期限", compute="_get_user_edit_credit_limit")
    allow_date = fields.Date(string=u"放宽期限")
    # red_line_of_credit = fields.Boolean(u'启用信用额度限制', default=False)

    @api.one
    def _get_user_edit_credit_limit(self):
        self.user_edit_credit_limit = self.env['res.users'].has_group('partner_credit_limit.credit_config')
